<!-- HTML header for doxygen 1.8.8-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <!-- For Mobile Devices -->
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
        <meta name="generator" content="Doxygen 1.8.18"/>
        <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
        <title>HElib: /HElib/include/helib/DoubleCRT.h Source File</title>
        <!--<link href="tabs.css" rel="stylesheet" type="text/css"/>-->
        <script type="text/javascript" src="dynsections.js"></script>
        <link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
        <link href="doxygen.css" rel="stylesheet" type="text/css" />
        <link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
        <link href='https://fonts.googleapis.com/css?family=Roboto+Slab' rel='stylesheet' type='text/css'>
		<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100;1,700&family=Merriweather&family=Merriweather+Sans&family=Open+Sans&family=Poppins:ital@1&family=Roboto:ital,wght@0,400;1,300;1,900&display=swap" rel="stylesheet"> 
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
        <link href="jquery.smartmenus.bootstrap.css" rel="stylesheet">
        <script type="text/javascript" src="jquery.smartmenus.js"></script>
        <!-- SmartMenus jQuery Bootstrap Addon -->
        <script type="text/javascript" src="jquery.smartmenus.bootstrap.js"></script>
        <!-- SmartMenus jQuery plugin -->
    </head>
    <body style="font-family: 'Merriweather', serif;">
        <nav class="navbar navbar-default" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <a class="navbar-brand">HElib Implementing Homomorphic Encryption</a>
                </div>
            </div>
        </nav>
        <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
            <div class="content" id="content">
                <div class="container">
                    <div class="row">
                        <div class="col-sm-12 panel " style="padding-bottom: 15px;">
                            <div style="margin-bottom: 15px;">
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_d0c4ae63660968bf6b1c77a1e8aecf95.html">helib</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">DoubleCRT.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_double_c_r_t_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/* Copyright (C) 2012-2020 IBM Corp.</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * This program is Licensed under the Apache License, Version 2.0</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * (the &quot;License&quot;); you may not use this file except in compliance</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * with the License. You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *   http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * limitations under the License. See accompanying LICENSE file.</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#ifndef HELIB_DOUBLECRT_H</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#define HELIB_DOUBLECRT_H</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160; </div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="zz_x_8h.html">helib/zzX.h</a>&gt;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="_numb_th_8h.html">helib/NumbTh.h</a>&gt;</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="_index_map_8h.html">helib/IndexMap.h</a>&gt;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="timing_8h.html">helib/timing.h</a>&gt;</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacehelib.html">helib</a> {</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160; </div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="keyword">class </span>Context;</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160; </div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t_helper.html">   33</a></span>&#160;<span class="keyword">class </span><a class="code" href="classhelib_1_1_double_c_r_t_helper.html">DoubleCRTHelper</a> : <span class="keyword">public</span> <a class="code" href="classhelib_1_1_index_map_init.html">IndexMapInit</a>&lt;NTL::vec_long&gt;</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;{</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;  <span class="keywordtype">long</span> val;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160; </div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t_helper.html">DoubleCRTHelper</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_context.html">Context</a>&amp; context);</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160; </div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t_helper.html#a2a5120c6b955c4cdc9aa6a998111614f">   42</a></span>&#160;  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_double_c_r_t_helper.html#a2a5120c6b955c4cdc9aa6a998111614f">init</a>(NTL::vec_long&amp; v) { v.FixLength(val); }</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160; </div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t_helper.html#ae3f615ca599a1e58c7eeff62da460dc3">   45</a></span>&#160;  <span class="keyword">virtual</span> <a class="code" href="classhelib_1_1_index_map_init.html">IndexMapInit&lt;NTL::vec_long&gt;</a>* <a class="code" href="classhelib_1_1_double_c_r_t_helper.html#ae3f615ca599a1e58c7eeff62da460dc3">clone</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="keyword">  </span>{</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classhelib_1_1_double_c_r_t_helper.html">DoubleCRTHelper</a>(*<span class="keyword">this</span>);</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;  }</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160; </div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t_helper.html">DoubleCRTHelper</a>(); <span class="comment">// disable default constructor</span></div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;};</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160; </div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html">   75</a></span>&#160;<span class="keyword">class </span><a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a></div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;{</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;  <span class="keyword">const</span> <a class="code" href="classhelib_1_1_context.html">Context</a>&amp; context; <span class="comment">// the context</span></div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160; </div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;  <span class="comment">// the data itself: if the i&#39;th prime is in use then map[i] is the std::vector</span></div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;  <span class="comment">// of evaluations wrt this prime</span></div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;  <a class="code" href="classhelib_1_1_index_map.html">IndexMap&lt;NTL::vec_long&gt;</a> map;</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160; </div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;  <span class="keywordtype">void</span> verify();</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160; </div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;  <span class="comment">// Generic operators.</span></div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;  <span class="comment">// The behavior when *this and other use different primes depends on the flag</span></div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;  <span class="comment">// matchIndexSets. When it is set to true then the effective modulus is</span></div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;  <span class="comment">// determined by the union of the two index sets; otherwise, the index set</span></div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;  <span class="comment">// of *this.</span></div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160; </div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;  <span class="keyword">class </span>AddFun</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;  {</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <span class="keywordtype">long</span> apply(<span class="keywordtype">long</span> a, <span class="keywordtype">long</span> b, <span class="keywordtype">long</span> n) { <span class="keywordflow">return</span> NTL::AddMod(a, b, n); }</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;  };</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160; </div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;  <span class="keyword">class </span>SubFun</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;  {</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="keywordtype">long</span> apply(<span class="keywordtype">long</span> a, <span class="keywordtype">long</span> b, <span class="keywordtype">long</span> n) { <span class="keywordflow">return</span> NTL::SubMod(a, b, n); }</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;  };</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160; </div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;  <span class="keyword">class </span>MulFun</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;  {</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <span class="keywordtype">long</span> apply(<span class="keywordtype">long</span> a, <span class="keywordtype">long</span> b, <span class="keywordtype">long</span> n) { <span class="keywordflow">return</span> <a class="code" href="namespacehelib.html#a8fc507c5ea1850c348a7c2d743b59a57">NTL::MulMod</a>(a, b, n); }</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;  };</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160; </div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Fun&gt;</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; Op(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; other, Fun fun, <span class="keywordtype">bool</span> matchIndexSets = <span class="keyword">true</span>);</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160; </div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; do_mul(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; other, <span class="keywordtype">bool</span> matchIndexSets = <span class="keyword">true</span>);</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160; </div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Fun&gt;</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; Op(<span class="keyword">const</span> NTL::ZZ&amp; num, Fun fun);</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160; </div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Fun&gt;</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; Op(<span class="keyword">const</span> NTL::ZZX&amp; poly, Fun fun);</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160; </div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;  <span class="comment">// Constructors and assignment operators</span></div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160; </div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;  <span class="comment">// representing an integer polynomial as DoubleCRT. If the set of primes</span></div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;  <span class="comment">// to use is not specified, the resulting object uses all the primes in</span></div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;  <span class="comment">// the context. If the coefficients of poly are larger than the product of</span></div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;  <span class="comment">// the used primes, they are effectively reduced modulo that product</span></div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160; </div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;  <span class="comment">// Default copy-constructor:</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#a631f72e6137f32949db5d7aafb44fda0">  131</a></span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html#a631f72e6137f32949db5d7aafb44fda0">DoubleCRT</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; other) = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160; </div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html#a631f72e6137f32949db5d7aafb44fda0">DoubleCRT</a>(<span class="keyword">const</span> NTL::ZZX&amp; poly,</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;            <span class="keyword">const</span> <a class="code" href="classhelib_1_1_context.html">Context</a>&amp; _context,</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;            <span class="keyword">const</span> <a class="code" href="classhelib_1_1_index_set.html">IndexSet</a>&amp; indexSet);</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160; </div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;<span class="comment">// FIXME-IndexSet</span></div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;<span class="preprocessor">#if 0</span></div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html#a631f72e6137f32949db5d7aafb44fda0">DoubleCRT</a>(<span class="keyword">const</span> NTL::ZZX&amp;poly, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_context.html">Context</a>&amp; _context);</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160; </div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;<span class="comment">// FIXME-IndexSet</span></div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;<span class="preprocessor">#if 0</span></div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160; </div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;  <span class="comment">//  declared &quot;explicit&quot; to avoid implicit type conversion</span></div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;  <span class="keyword">explicit</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a631f72e6137f32949db5d7aafb44fda0">DoubleCRT</a>(<span class="keyword">const</span> NTL::ZZX&amp;poly);</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160; </div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html#a631f72e6137f32949db5d7aafb44fda0">DoubleCRT</a>(<span class="keyword">const</span> <a class="code" href="namespacehelib.html#a4d6002f36f1a61982fded09adf1331ca">zzX</a>&amp; poly, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_context.html">Context</a>&amp; _context, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_index_set.html">IndexSet</a>&amp; indexSet);</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160; </div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;<span class="comment">// FIXME-IndexSet</span></div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;<span class="preprocessor">#if 0</span></div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html#a631f72e6137f32949db5d7aafb44fda0">DoubleCRT</a>(<span class="keyword">const</span> <a class="code" href="namespacehelib.html#a4d6002f36f1a61982fded09adf1331ca">zzX</a>&amp;poly, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_context.html">Context</a>&amp; _context);</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;  <span class="keyword">explicit</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a631f72e6137f32949db5d7aafb44fda0">DoubleCRT</a>(<span class="keyword">const</span> <a class="code" href="namespacehelib.html#a4d6002f36f1a61982fded09adf1331ca">zzX</a>&amp;poly);</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160; </div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;<span class="comment">// FIXME-IndexSet</span></div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;<span class="preprocessor">#if 0</span></div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;  <span class="comment">// Without specifying a ZZX, we get the zero polynomial</span></div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;  <span class="keyword">explicit</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a631f72e6137f32949db5d7aafb44fda0">DoubleCRT</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_context.html">Context</a> &amp;_context);</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;  <span class="comment">// declare &quot;explicit&quot; to avoid implicit type conversion</span></div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160; </div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html#a631f72e6137f32949db5d7aafb44fda0">DoubleCRT</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_context.html">Context</a>&amp; _context, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_index_set.html">IndexSet</a>&amp; indexSet);</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160; </div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;  <span class="comment">// Assignment operator, the following two lines are equivalent:</span></div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;  <span class="comment">//    DoubleCRT dCRT(poly, context, indexSet);</span></div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;  <span class="comment">// or</span></div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;  <span class="comment">//    DoubleCRT dCRT(context, indexSet); dCRT = poly;</span></div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160; </div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#a359081fc6e97ee9d6ee8850e85458a79">operator=</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; other);</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160; </div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;  <span class="comment">// Copy only the primes in s \intersect other.getIndexSet()</span></div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;  <span class="comment">//  void partialCopy(const DoubleCRT&amp; other, const IndexSet&amp; s);</span></div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160; </div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#a359081fc6e97ee9d6ee8850e85458a79">operator=</a>(<span class="keyword">const</span> <a class="code" href="namespacehelib.html#a4d6002f36f1a61982fded09adf1331ca">zzX</a>&amp; poly);</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#a359081fc6e97ee9d6ee8850e85458a79">operator=</a>(<span class="keyword">const</span> NTL::ZZX&amp; poly);</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#a359081fc6e97ee9d6ee8850e85458a79">operator=</a>(<span class="keyword">const</span> NTL::ZZ&amp; num);</div>
<div class="line"><a name="l00190"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#aeb0601dd78afd903d603e262e0106c53">  190</a></span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#aeb0601dd78afd903d603e262e0106c53">operator=</a>(<span class="keyword">const</span> <span class="keywordtype">long</span> num)</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;  {</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    *<span class="keyword">this</span> = NTL::to_ZZ(num);</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;  }</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160; </div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#aad46265bdefb14d5883c552c29ee773f">getOneRow</a>(NTL::Vec&lt;long&gt;&amp; row, <span class="keywordtype">long</span> idx, <span class="keywordtype">bool</span> positive = <span class="keyword">false</span>) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#aad46265bdefb14d5883c552c29ee773f">getOneRow</a>(NTL::zz_pX&amp; row, <span class="keywordtype">long</span> idx) <span class="keyword">const</span>; <span class="comment">// This affects NTL&#39;s modulus</span></div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160; </div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a80f58978e1b572fcf7a3d012f4a69f23">toPoly</a>(NTL::ZZX&amp; p, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_index_set.html">IndexSet</a>&amp; s, <span class="keywordtype">bool</span> positive = <span class="keyword">false</span>) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a80f58978e1b572fcf7a3d012f4a69f23">toPoly</a>(NTL::ZZX&amp; p, <span class="keywordtype">bool</span> positive = <span class="keyword">false</span>) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160; </div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;  <span class="comment">// The variant toPolyMod has another argument, which is a modulus Q, and it</span></div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;  <span class="comment">// computes toPoly() mod Q. This is offered as a separate function in the</span></div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;  <span class="comment">// hope that one day we will figure out a more efficient method of computing</span></div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;  <span class="comment">// this. Right now it is not implemented</span></div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;  <span class="comment">//</span></div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;  <span class="comment">// void toPolyMod(ZZX&amp; p, const ZZ &amp;Q, const IndexSet&amp; s) const;</span></div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160; </div>
<div class="line"><a name="l00216"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#ad96a04f62a268aa387cd4dbc456ab784">  216</a></span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#ad96a04f62a268aa387cd4dbc456ab784">operator==</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; other)<span class="keyword"> const</span></div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;<span class="keyword">  </span>{</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;    <a class="code" href="namespacehelib.html#aec77ae5fa0fd11a0a42e07fefe49b99d">assertEq</a>(&amp;context,</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;             &amp;other.context,</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;             <span class="stringliteral">&quot;Cannot compare DoubleCRTs with different context&quot;</span>);</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    <span class="keywordflow">return</span> map == other.map;</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;  }</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160; </div>
<div class="line"><a name="l00224"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#a602435fa109d85c1a896b7dcb614c1a3">  224</a></span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a602435fa109d85c1a896b7dcb614c1a3">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> !(*<span class="keyword">this</span> == other); }</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160; </div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;  <span class="comment">// @brief Set to zero</span></div>
<div class="line"><a name="l00227"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#a68dbfc4cbeb18fa08fd6309719645a32">  227</a></span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#a68dbfc4cbeb18fa08fd6309719645a32">SetZero</a>()</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;  {</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;    *<span class="keyword">this</span> = NTL::ZZ::zero();</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;    <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;  }</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160; </div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;  <span class="comment">// @brief Set to one</span></div>
<div class="line"><a name="l00234"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#a60f6697ca6a3c56375b2f9650e108497">  234</a></span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#a60f6697ca6a3c56375b2f9650e108497">SetOne</a>()</div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;  {</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;    *<span class="keyword">this</span> = 1;</div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;    <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;  }</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160; </div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;  NTL::xdouble <a class="code" href="classhelib_1_1_double_c_r_t.html#a6344aee3b06c937a8a357e9add21d0d1">breakIntoDigits</a>(std::vector&lt;DoubleCRT&gt;&amp; dgts) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160; </div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a27064d89f77f57740b03d2108fe62d0f">addPrimes</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_index_set.html">IndexSet</a>&amp; s1, NTL::ZZX* poly_p = 0);</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160; </div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;  <span class="keywordtype">double</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a8a09a101d684b9f2a444c27febdff627">addPrimesAndScale</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_index_set.html">IndexSet</a>&amp; s1);</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160; </div>
<div class="line"><a name="l00256"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#a9933c593e0ce6b46f1559a6a181a4939">  256</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a9933c593e0ce6b46f1559a6a181a4939">removePrimes</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_index_set.html">IndexSet</a>&amp; s1) { map.<a class="code" href="classhelib_1_1_index_map.html#a71e808a119fbe9f2af2ea4d7547f9207">remove</a>(s1); }</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160; </div>
<div class="line"><a name="l00259"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#a067a11ce98dc23c255e8e14469936a0d">  259</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a067a11ce98dc23c255e8e14469936a0d">setPrimes</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_index_set.html">IndexSet</a>&amp; s1)</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;  {</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;    <a class="code" href="classhelib_1_1_double_c_r_t.html#a27064d89f77f57740b03d2108fe62d0f">addPrimes</a>(s1 / <a class="code" href="classhelib_1_1_double_c_r_t.html#ab7c5ce0eed18d35a864b89198e5b2f9f">getIndexSet</a>());</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;    <a class="code" href="classhelib_1_1_double_c_r_t.html#a9933c593e0ce6b46f1559a6a181a4939">removePrimes</a>(<a class="code" href="classhelib_1_1_double_c_r_t.html#ab7c5ce0eed18d35a864b89198e5b2f9f">getIndexSet</a>() / s1);</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;  }</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160; </div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160; </div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;  <span class="comment">// Addition, negation, subtraction</span></div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#a5979ae811d8392e902d52441a3906f6f">Negate</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; other);</div>
<div class="line"><a name="l00274"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#a5979ae811d8392e902d52441a3906f6f">  274</a></span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#a5979ae811d8392e902d52441a3906f6f">Negate</a>() { <span class="keywordflow">return</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a5979ae811d8392e902d52441a3906f6f">Negate</a>(*<span class="keyword">this</span>); }</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160; </div>
<div class="line"><a name="l00276"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#ab862cf071d7d9b4705a71a12276c7448">  276</a></span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#ab862cf071d7d9b4705a71a12276c7448">operator+=</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; other) { <span class="keywordflow">return</span> Op(other, AddFun()); }</div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160; </div>
<div class="line"><a name="l00278"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#afcbce63268124352f675ffdcf1d9fbc6">  278</a></span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#afcbce63268124352f675ffdcf1d9fbc6">operator+=</a>(<span class="keyword">const</span> NTL::ZZX&amp; poly) { <span class="keywordflow">return</span> Op(poly, AddFun()); }</div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160; </div>
<div class="line"><a name="l00280"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#a09c2f0e8a49dec1a23cba7514db21956">  280</a></span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#a09c2f0e8a49dec1a23cba7514db21956">operator+=</a>(<span class="keyword">const</span> NTL::ZZ&amp; num) { <span class="keywordflow">return</span> Op(num, AddFun()); }</div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160; </div>
<div class="line"><a name="l00282"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#aa04acff3373bda5e2eb2362106646ee5">  282</a></span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#aa04acff3373bda5e2eb2362106646ee5">operator+=</a>(<span class="keywordtype">long</span> num) { <span class="keywordflow">return</span> Op(NTL::to_ZZ(num), AddFun()); }</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160; </div>
<div class="line"><a name="l00284"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#ac2e5c6c1238fb7bfcab215213d57cc13">  284</a></span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#ac2e5c6c1238fb7bfcab215213d57cc13">operator-=</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; other) { <span class="keywordflow">return</span> Op(other, SubFun()); }</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160; </div>
<div class="line"><a name="l00286"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#a4c6b425dcc3dda0ebb07b153c39f2b0d">  286</a></span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#a4c6b425dcc3dda0ebb07b153c39f2b0d">operator-=</a>(<span class="keyword">const</span> NTL::ZZX&amp; poly) { <span class="keywordflow">return</span> Op(poly, SubFun()); }</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160; </div>
<div class="line"><a name="l00288"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#a8d8ba7dddd582076f9b7b7500b4c9f55">  288</a></span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#a8d8ba7dddd582076f9b7b7500b4c9f55">operator-=</a>(<span class="keyword">const</span> NTL::ZZ&amp; num) { <span class="keywordflow">return</span> Op(num, SubFun()); }</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160; </div>
<div class="line"><a name="l00290"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#a91e564b60dd913a2255718a1fa5fe0d7">  290</a></span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#a91e564b60dd913a2255718a1fa5fe0d7">operator-=</a>(<span class="keywordtype">long</span> num) { <span class="keywordflow">return</span> Op(NTL::to_ZZ(num), SubFun()); }</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160; </div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;  <span class="comment">// These are the prefix versions, ++dcrt and --dcrt.</span></div>
<div class="line"><a name="l00293"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#a57655b2b38af885b0fa4c67113b7b14d">  293</a></span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#a57655b2b38af885b0fa4c67113b7b14d">operator++</a>() { <span class="keywordflow">return</span> (*<span class="keyword">this</span> += 1); };</div>
<div class="line"><a name="l00294"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#adf65ecd249ea4bec214df9e74ac5610b">  294</a></span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#adf65ecd249ea4bec214df9e74ac5610b">operator--</a>() { <span class="keywordflow">return</span> (*<span class="keyword">this</span> -= 1); };</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160; </div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;  <span class="comment">// These are the postfix versions -- return type is void,</span></div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;  <span class="comment">// so it is offered just for style...</span></div>
<div class="line"><a name="l00298"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#aa6213e7fbf81a7d76a7a3eca2c255bf4">  298</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#aa6213e7fbf81a7d76a7a3eca2c255bf4">operator++</a>(<span class="keywordtype">int</span>) { *<span class="keyword">this</span> += 1; };</div>
<div class="line"><a name="l00299"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#af486580b8d08571567e26c5e3d63f1bb">  299</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#af486580b8d08571567e26c5e3d63f1bb">operator--</a>(<span class="keywordtype">int</span>) { *<span class="keyword">this</span> -= 1; };</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160; </div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;  <span class="comment">// Multiplication</span></div>
<div class="line"><a name="l00302"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#a5eaea93daef76b525e97bed6baffaf75">  302</a></span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#a5eaea93daef76b525e97bed6baffaf75">operator*=</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; other)</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;  {</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;    <span class="comment">// return Op(other,MulFun());</span></div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;    <span class="keywordflow">return</span> do_mul(other);</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;  }</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160; </div>
<div class="line"><a name="l00308"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#a2208cba94ed47b3062e33d09d9bcd04f">  308</a></span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#a2208cba94ed47b3062e33d09d9bcd04f">operator*=</a>(<span class="keyword">const</span> NTL::ZZX&amp; poly) { <span class="keywordflow">return</span> Op(poly, MulFun()); }</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160; </div>
<div class="line"><a name="l00310"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#ae84322d510fb43f4e1307ef494f1027f">  310</a></span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#ae84322d510fb43f4e1307ef494f1027f">operator*=</a>(<span class="keyword">const</span> NTL::ZZ&amp; num) { <span class="keywordflow">return</span> Op(num, MulFun()); }</div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160; </div>
<div class="line"><a name="l00312"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#a40fff78be8f0d474de64963f8a3c5344">  312</a></span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#a40fff78be8f0d474de64963f8a3c5344">operator*=</a>(<span class="keywordtype">long</span> num) { <span class="keywordflow">return</span> Op(NTL::to_ZZ(num), MulFun()); }</div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160; </div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;  <span class="comment">// Procedural equivalents, supporting also the matchIndexSets flag</span></div>
<div class="line"><a name="l00315"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#aa8f223c17ea3db63f0e85a951d5854d4">  315</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#aa8f223c17ea3db63f0e85a951d5854d4">Add</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; other, <span class="keywordtype">bool</span> matchIndexSets = <span class="keyword">true</span>)</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;  {</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;    Op(other, AddFun(), matchIndexSets);</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;  }</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160; </div>
<div class="line"><a name="l00320"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#a328217c45be92b409dc511fb7b5116a5">  320</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a328217c45be92b409dc511fb7b5116a5">Sub</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; other, <span class="keywordtype">bool</span> matchIndexSets = <span class="keyword">true</span>)</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;  {</div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;    Op(other, SubFun(), matchIndexSets);</div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;  }</div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160; </div>
<div class="line"><a name="l00325"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#a045b2bda01f9ff183b5e31e6b90bc4cf">  325</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a045b2bda01f9ff183b5e31e6b90bc4cf">Mul</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; other, <span class="keywordtype">bool</span> matchIndexSets = <span class="keyword">true</span>)</div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;  {</div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;    <span class="comment">// Op(other, MulFun(), matchIndexSets);</span></div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;    do_mul(other, matchIndexSets);</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;  }</div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160; </div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;  <span class="comment">// Division by constant</span></div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#a0e1ea42768fc1e149624014c3cdda7cb">operator/=</a>(<span class="keyword">const</span> NTL::ZZ&amp; num);</div>
<div class="line"><a name="l00333"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#ac849949bc5328c67aad30e1a1b607ba9">  333</a></span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#ac849949bc5328c67aad30e1a1b607ba9">operator/=</a>(<span class="keywordtype">long</span> num) { <span class="keywordflow">return</span> (*<span class="keyword">this</span> /= NTL::to_ZZ(num)); }</div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160; </div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#aad5a926f22147af844cc596f9ff55ad3">Exp</a>(<span class="keywordtype">long</span> k);</div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160; </div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#afac4fc2420b57eeb2eb8a0faa136396e">automorph</a>(<span class="keywordtype">long</span> k);</div>
<div class="line"><a name="l00340"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#a312c1538cfa9f1107e71164b04e0e9f7">  340</a></span>&#160;  <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#a312c1538cfa9f1107e71164b04e0e9f7">operator&gt;&gt;=</a>(<span class="keywordtype">long</span> k)</div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;  {</div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;    <a class="code" href="classhelib_1_1_double_c_r_t.html#afac4fc2420b57eeb2eb8a0faa136396e">automorph</a>(k);</div>
<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;    <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;  }</div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160; </div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#ad7d7e5ac67bf14b1136bf025277e955c">complexConj</a>();</div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160; </div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;  <span class="comment">// Utilities</span></div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160; </div>
<div class="line"><a name="l00352"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#abe8873e29757567be4b676e032bb3b7a">  352</a></span>&#160;  <span class="keyword">const</span> <a class="code" href="classhelib_1_1_context.html">Context</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#abe8873e29757567be4b676e032bb3b7a">getContext</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> context; }</div>
<div class="line"><a name="l00353"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#a67066e369b697046fd17f7f39a17bf58">  353</a></span>&#160;  <span class="keyword">const</span> <a class="code" href="classhelib_1_1_index_map.html">IndexMap&lt;NTL::vec_long&gt;</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#a67066e369b697046fd17f7f39a17bf58">getMap</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> map; }</div>
<div class="line"><a name="l00354"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#ab7c5ce0eed18d35a864b89198e5b2f9f">  354</a></span>&#160;  <span class="keyword">const</span> <a class="code" href="classhelib_1_1_index_set.html">IndexSet</a>&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#ab7c5ce0eed18d35a864b89198e5b2f9f">getIndexSet</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> map.<a class="code" href="classhelib_1_1_index_map.html#ab90e2fb448b41be128b5d41a5dbd27e9">getIndexSet</a>(); }</div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160; </div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;  <span class="comment">// Choose random DoubleCRT&#39;s, either at random or with small/Gaussian</span></div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;  <span class="comment">// coefficients.</span></div>
<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160; </div>
<div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a9535bb1c1cff9fbedacfcc56a8f4ab4e">randomize</a>(<span class="keyword">const</span> NTL::ZZ* seed = <span class="keyword">nullptr</span>);</div>
<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160; </div>
<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160; </div>
<div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;  <span class="keywordtype">double</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a842f11906b1bc36b48ae4a8d62b4ff91">sampleSmall</a>();</div>
<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;  <span class="keywordtype">double</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a91d2454818d59f6ea29c277844e7957f">sampleSmallBounded</a>();</div>
<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160; </div>
<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;  <span class="keywordtype">double</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#ad1e6674862ea6da74cc3a8f1a901cef1">sampleHWt</a>(<span class="keywordtype">long</span> Hwt);</div>
<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;  <span class="keywordtype">double</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a5bd69bc52fb02706a8dc81c6f9fcf9b6">sampleHWtBounded</a>(<span class="keywordtype">long</span> Hwt);</div>
<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160; </div>
<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;  <span class="keywordtype">double</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#ad7e6888ef2bac98a54e7088c82d2e87f">sampleGaussian</a>(<span class="keywordtype">double</span> stdev = 0.0);</div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;  <span class="keywordtype">double</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a45409981c85d5948123c93e8efeb60b2">sampleGaussianBounded</a>(<span class="keywordtype">double</span> stdev = 0.0);</div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160; </div>
<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;  <span class="keywordtype">double</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a8ea63e63721e62276f1277eaeefa25f8">sampleUniform</a>(<span class="keywordtype">long</span> B);</div>
<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;  NTL::xdouble <a class="code" href="classhelib_1_1_double_c_r_t.html#a8ea63e63721e62276f1277eaeefa25f8">sampleUniform</a>(<span class="keyword">const</span> NTL::ZZ&amp; B);</div>
<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160; </div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;  <span class="comment">// used to implement modulus switching</span></div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a1d18d021e42bb0fcf2ed970c6fa599c8">scaleDownToSet</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_index_set.html">IndexSet</a>&amp; s, <span class="keywordtype">long</span> ptxtSpace, NTL::ZZX&amp; delta);</div>
<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160; </div>
<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a86bba624e14ddc8a86e5228c1e2bffad">FFT</a>(<span class="keyword">const</span> NTL::ZZX&amp; poly, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_index_set.html">IndexSet</a>&amp; s);</div>
<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a86bba624e14ddc8a86e5228c1e2bffad">FFT</a>(<span class="keyword">const</span> <a class="code" href="namespacehelib.html#a4d6002f36f1a61982fded09adf1331ca">zzX</a>&amp; poly, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_index_set.html">IndexSet</a>&amp; s);</div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;  <span class="comment">// for internal use</span></div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160; </div>
<div class="line"><a name="l00390"></a><span class="lineno"><a class="line" href="classhelib_1_1_double_c_r_t.html#a8f89ba3eda006c1fc14b7b52fe7ca4f3">  390</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a8f89ba3eda006c1fc14b7b52fe7ca4f3">reduce</a>()<span class="keyword"> const </span>{} <span class="comment">// place-holder for consistent with AltCRT</span></div>
<div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160; </div>
<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;  <span class="comment">// Raw I/O</span></div>
<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#afb6579645cacc13b3c4c4f61229f6231">read</a>(std::istream&amp; str);</div>
<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_double_c_r_t.html#a36127a66a5b6bd2645676edcfb84efdb">write</a>(std::ostream&amp; str) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160; </div>
<div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;  <span class="comment">// I/O: ONLY the matrix is outputted/recovered, not the moduli chain!! An</span></div>
<div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;  <span class="comment">// error is raised on input if this is not consistent with the current chain</span></div>
<div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160; </div>
<div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;  <span class="keyword">friend</span> std::ostream&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#ae9dd652a2d96b2e1892c1bc049237507">operator&lt;&lt;</a>(std::ostream&amp; s, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; d);</div>
<div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;  <span class="keyword">friend</span> std::istream&amp; <a class="code" href="classhelib_1_1_double_c_r_t.html#a5e6c49b414a807b023ddb01d66324a0c">operator&gt;&gt;</a>(std::istream&amp; s, <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; d);</div>
<div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;};</div>
<div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160; </div>
<div class="line"><a name="l00403"></a><span class="lineno"><a class="line" href="namespacehelib.html#af5a79c25bb9e1285c93b486ce07c4d52">  403</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacehelib.html#af5a79c25bb9e1285c93b486ce07c4d52">conv</a>(<a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; d, <span class="keyword">const</span> NTL::ZZX&amp; p) { d = p; }</div>
<div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160; </div>
<div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;<span class="comment">// FIXME-IndexSet</span></div>
<div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;<span class="preprocessor">#if 0</span></div>
<div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;<span class="keyword">inline</span> DoubleCRT to_DoubleCRT(<span class="keyword">const</span> NTL::ZZX&amp; p) {</div>
<div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160;  <span class="keywordflow">return</span> DoubleCRT(p);</div>
<div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;}</div>
<div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160; </div>
<div class="line"><a name="l00412"></a><span class="lineno"><a class="line" href="namespacehelib.html#a5f5fe8f0918a6b964a75728b61d15c2c">  412</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacehelib.html#af5a79c25bb9e1285c93b486ce07c4d52">conv</a>(NTL::ZZX&amp; p, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; d) { d.<a class="code" href="classhelib_1_1_double_c_r_t.html#a80f58978e1b572fcf7a3d012f4a69f23">toPoly</a>(p); }</div>
<div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160; </div>
<div class="line"><a name="l00414"></a><span class="lineno"><a class="line" href="namespacehelib.html#ac584b135744603cdff25e2db01b9463a">  414</a></span>&#160;<span class="keyword">inline</span> NTL::ZZX <a class="code" href="namespacehelib.html#ac584b135744603cdff25e2db01b9463a">to_ZZX</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_double_c_r_t.html">DoubleCRT</a>&amp; d)</div>
<div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;{</div>
<div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;  NTL::ZZX p;</div>
<div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;  d.<a class="code" href="classhelib_1_1_double_c_r_t.html#a80f58978e1b572fcf7a3d012f4a69f23">toPoly</a>(p);</div>
<div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;  <span class="keywordflow">return</span> p;</div>
<div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;}</div>
<div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160; </div>
<div class="line"><a name="l00421"></a><span class="lineno"><a class="line" href="namespacehelib.html#a428c028bc71d7be0bdaa0118f286ee2e">  421</a></span>&#160;<span class="keyword">typedef</span> std::shared_ptr&lt;DoubleCRT&gt; <a class="code" href="namespacehelib.html#a428c028bc71d7be0bdaa0118f286ee2e">DCRTptr</a>;</div>
<div class="line"><a name="l00422"></a><span class="lineno"><a class="line" href="namespacehelib.html#a3652f33aab9e225a4c136eb14a50bc53">  422</a></span>&#160;<span class="keyword">typedef</span> std::shared_ptr&lt;NTL::ZZX&gt; <a class="code" href="namespacehelib.html#a3652f33aab9e225a4c136eb14a50bc53">ZZXptr</a>;</div>
<div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160; </div>
<div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160;} <span class="comment">// namespace helib</span></div>
<div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160; </div>
<div class="line"><a name="l00426"></a><span class="lineno">  426</span>&#160;<span class="preprocessor">#endif // #ifndef HELIB_DOUBLECRT_H</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a60f6697ca6a3c56375b2f9650e108497"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a60f6697ca6a3c56375b2f9650e108497">helib::DoubleCRT::SetOne</a></div><div class="ttdeci">DoubleCRT &amp; SetOne()</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:234</div></div>
<div class="ttc" id="atiming_8h_html"><div class="ttname"><a href="timing_8h.html">timing.h</a></div><div class="ttdoc">Utility functions for measuring time.</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_ad7d7e5ac67bf14b1136bf025277e955c"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#ad7d7e5ac67bf14b1136bf025277e955c">helib::DoubleCRT::complexConj</a></div><div class="ttdeci">void complexConj()</div><div class="ttdoc">Compute the complex conjugate, the same as automorph(m-1)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:1059</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_ae84322d510fb43f4e1307ef494f1027f"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#ae84322d510fb43f4e1307ef494f1027f">helib::DoubleCRT::operator*=</a></div><div class="ttdeci">DoubleCRT &amp; operator*=(const NTL::ZZ &amp;num)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:310</div></div>
<div class="ttc" id="anamespacehelib_html_ac584b135744603cdff25e2db01b9463a"><div class="ttname"><a href="namespacehelib.html#ac584b135744603cdff25e2db01b9463a">helib::to_ZZX</a></div><div class="ttdeci">NTL::ZZX to_ZZX(const DoubleCRT &amp;d)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:414</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a67066e369b697046fd17f7f39a17bf58"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a67066e369b697046fd17f7f39a17bf58">helib::DoubleCRT::getMap</a></div><div class="ttdeci">const IndexMap&lt; NTL::vec_long &gt; &amp; getMap() const</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:353</div></div>
<div class="ttc" id="anamespacehelib_html_a4d6002f36f1a61982fded09adf1331ca"><div class="ttname"><a href="namespacehelib.html#a4d6002f36f1a61982fded09adf1331ca">helib::zzX</a></div><div class="ttdeci">NTL::Vec&lt; long &gt; zzX</div><div class="ttdef"><b>Definition:</b> zzX.h:24</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html">helib::DoubleCRT</a></div><div class="ttdoc">Implementing polynomials (elements in the ring R_Q) in double-CRT form.</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:76</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a80f58978e1b572fcf7a3d012f4a69f23"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a80f58978e1b572fcf7a3d012f4a69f23">helib::DoubleCRT::toPoly</a></div><div class="ttdeci">void toPoly(NTL::ZZX &amp;p, const IndexSet &amp;s, bool positive=false) const</div><div class="ttdoc">Recovering the polynomial in coefficient representation. This yields an integer polynomial with coeff...</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:744</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_aad46265bdefb14d5883c552c29ee773f"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#aad46265bdefb14d5883c552c29ee773f">helib::DoubleCRT::getOneRow</a></div><div class="ttdeci">long getOneRow(NTL::Vec&lt; long &gt; &amp;row, long idx, bool positive=false) const</div><div class="ttdoc">Get one row of a polynomial.</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:720</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a5bd69bc52fb02706a8dc81c6f9fcf9b6"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a5bd69bc52fb02706a8dc81c6f9fcf9b6">helib::DoubleCRT::sampleHWtBounded</a></div><div class="ttdeci">double sampleHWtBounded(long Hwt)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:1230</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_aa04acff3373bda5e2eb2362106646ee5"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#aa04acff3373bda5e2eb2362106646ee5">helib::DoubleCRT::operator+=</a></div><div class="ttdeci">DoubleCRT &amp; operator+=(long num)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:282</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_abe8873e29757567be4b676e032bb3b7a"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#abe8873e29757567be4b676e032bb3b7a">helib::DoubleCRT::getContext</a></div><div class="ttdeci">const Context &amp; getContext() const</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:352</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a8d8ba7dddd582076f9b7b7500b4c9f55"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a8d8ba7dddd582076f9b7b7500b4c9f55">helib::DoubleCRT::operator-=</a></div><div class="ttdeci">DoubleCRT &amp; operator-=(const NTL::ZZ &amp;num)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:288</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a45409981c85d5948123c93e8efeb60b2"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a45409981c85d5948123c93e8efeb60b2">helib::DoubleCRT::sampleGaussianBounded</a></div><div class="ttdeci">double sampleGaussianBounded(double stdev=0.0)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:1249</div></div>
<div class="ttc" id="aclasshelib_1_1_index_map_html_ab90e2fb448b41be128b5d41a5dbd27e9"><div class="ttname"><a href="classhelib_1_1_index_map.html#ab90e2fb448b41be128b5d41a5dbd27e9">helib::IndexMap::getIndexSet</a></div><div class="ttdeci">const IndexSet &amp; getIndexSet() const</div><div class="ttdoc">Get the underlying index set.</div><div class="ttdef"><b>Definition:</b> IndexMap.h:65</div></div>
<div class="ttc" id="a_numb_th_8h_html"><div class="ttname"><a href="_numb_th_8h.html">NumbTh.h</a></div><div class="ttdoc">Miscellaneous utility functions.</div></div>
<div class="ttc" id="anamespacehelib_html_aec77ae5fa0fd11a0a42e07fefe49b99d"><div class="ttname"><a href="namespacehelib.html#aec77ae5fa0fd11a0a42e07fefe49b99d">helib::assertEq</a></div><div class="ttdeci">void assertEq(const T &amp;a, const T &amp;b, const std::string &amp;message)</div><div class="ttdef"><b>Definition:</b> assertions.h:108</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_af486580b8d08571567e26c5e3d63f1bb"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#af486580b8d08571567e26c5e3d63f1bb">helib::DoubleCRT::operator--</a></div><div class="ttdeci">void operator--(int)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:299</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a602435fa109d85c1a896b7dcb614c1a3"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a602435fa109d85c1a896b7dcb614c1a3">helib::DoubleCRT::operator!=</a></div><div class="ttdeci">bool operator!=(const DoubleCRT &amp;other) const</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:224</div></div>
<div class="ttc" id="aclasshelib_1_1_index_map_html"><div class="ttname"><a href="classhelib_1_1_index_map.html">helib::IndexMap&lt; NTL::vec_long &gt;</a></div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a5e6c49b414a807b023ddb01d66324a0c"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a5e6c49b414a807b023ddb01d66324a0c">helib::DoubleCRT::operator&gt;&gt;</a></div><div class="ttdeci">friend std::istream &amp; operator&gt;&gt;(std::istream &amp;s, DoubleCRT &amp;d)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:1343</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_helper_html_ae3f615ca599a1e58c7eeff62da460dc3"><div class="ttname"><a href="classhelib_1_1_double_c_r_t_helper.html#ae3f615ca599a1e58c7eeff62da460dc3">helib::DoubleCRTHelper::clone</a></div><div class="ttdeci">virtual IndexMapInit&lt; NTL::vec_long &gt; * clone() const</div><div class="ttdoc">clone allocates a new object and copies the content</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:45</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_afb6579645cacc13b3c4c4f61229f6231"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#afb6579645cacc13b3c4c4f61229f6231">helib::DoubleCRT::read</a></div><div class="ttdeci">void read(std::istream &amp;str)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:1393</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_ad7e6888ef2bac98a54e7088c82d2e87f"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#ad7e6888ef2bac98a54e7088c82d2e87f">helib::DoubleCRT::sampleGaussian</a></div><div class="ttdeci">double sampleGaussian(double stdev=0.0)</div><div class="ttdoc">Coefficients are Gaussians Return a high probability bound on L-infty norm of canonical embedding.</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:1239</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a40fff78be8f0d474de64963f8a3c5344"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a40fff78be8f0d474de64963f8a3c5344">helib::DoubleCRT::operator*=</a></div><div class="ttdeci">DoubleCRT &amp; operator*=(long num)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:312</div></div>
<div class="ttc" id="aclasshelib_1_1_index_set_html"><div class="ttname"><a href="classhelib_1_1_index_set.html">helib::IndexSet</a></div><div class="ttdoc">A dynamic set of non-negative integers.</div><div class="ttdef"><b>Definition:</b> IndexSet.h:31</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_ab7c5ce0eed18d35a864b89198e5b2f9f"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#ab7c5ce0eed18d35a864b89198e5b2f9f">helib::DoubleCRT::getIndexSet</a></div><div class="ttdeci">const IndexSet &amp; getIndexSet() const</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:354</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_ad96a04f62a268aa387cd4dbc456ab784"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#ad96a04f62a268aa387cd4dbc456ab784">helib::DoubleCRT::operator==</a></div><div class="ttdeci">bool operator==(const DoubleCRT &amp;other) const</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:216</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_helper_html"><div class="ttname"><a href="classhelib_1_1_double_c_r_t_helper.html">helib::DoubleCRTHelper</a></div><div class="ttdoc">A helper class to enforce consistency within an DoubleCRTHelper object.</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:34</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_aeb0601dd78afd903d603e262e0106c53"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#aeb0601dd78afd903d603e262e0106c53">helib::DoubleCRT::operator=</a></div><div class="ttdeci">DoubleCRT &amp; operator=(const long num)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:190</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a36127a66a5b6bd2645676edcfb84efdb"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a36127a66a5b6bd2645676edcfb84efdb">helib::DoubleCRT::write</a></div><div class="ttdeci">void write(std::ostream &amp;str) const</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:1381</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a4c6b425dcc3dda0ebb07b153c39f2b0d"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a4c6b425dcc3dda0ebb07b153c39f2b0d">helib::DoubleCRT::operator-=</a></div><div class="ttdeci">DoubleCRT &amp; operator-=(const NTL::ZZX &amp;poly)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:286</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a9933c593e0ce6b46f1559a6a181a4939"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a9933c593e0ce6b46f1559a6a181a4939">helib::DoubleCRT::removePrimes</a></div><div class="ttdeci">void removePrimes(const IndexSet &amp;s1)</div><div class="ttdoc">Remove s1 from the index set.</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:256</div></div>
<div class="ttc" id="anamespacehelib_html_a428c028bc71d7be0bdaa0118f286ee2e"><div class="ttname"><a href="namespacehelib.html#a428c028bc71d7be0bdaa0118f286ee2e">helib::DCRTptr</a></div><div class="ttdeci">std::shared_ptr&lt; DoubleCRT &gt; DCRTptr</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:421</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_adf65ecd249ea4bec214df9e74ac5610b"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#adf65ecd249ea4bec214df9e74ac5610b">helib::DoubleCRT::operator--</a></div><div class="ttdeci">DoubleCRT &amp; operator--()</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:294</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_ad1e6674862ea6da74cc3a8f1a901cef1"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#ad1e6674862ea6da74cc3a8f1a901cef1">helib::DoubleCRT::sampleHWt</a></div><div class="ttdeci">double sampleHWt(long Hwt)</div><div class="ttdoc">Coefficients are -1/0/1 with pre-specified number of nonzeros.</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:1221</div></div>
<div class="ttc" id="anamespacehelib_html_a8fc507c5ea1850c348a7c2d743b59a57"><div class="ttname"><a href="namespacehelib.html#a8fc507c5ea1850c348a7c2d743b59a57">helib::MulMod</a></div><div class="ttdeci">void MulMod(NTL::ZZX &amp;out, const NTL::ZZX &amp;f, long a, long q, bool abs)</div><div class="ttdef"><b>Definition:</b> NumbTh.cpp:829</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a359081fc6e97ee9d6ee8850e85458a79"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a359081fc6e97ee9d6ee8850e85458a79">helib::DoubleCRT::operator=</a></div><div class="ttdeci">DoubleCRT &amp; operator=(const DoubleCRT &amp;other)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:634</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_ac849949bc5328c67aad30e1a1b607ba9"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#ac849949bc5328c67aad30e1a1b607ba9">helib::DoubleCRT::operator/=</a></div><div class="ttdeci">DoubleCRT &amp; operator/=(long num)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:333</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a0e1ea42768fc1e149624014c3cdda7cb"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a0e1ea42768fc1e149624014c3cdda7cb">helib::DoubleCRT::operator/=</a></div><div class="ttdeci">DoubleCRT &amp; operator/=(const NTL::ZZ &amp;num)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:941</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a91d2454818d59f6ea29c277844e7957f"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a91d2454818d59f6ea29c277844e7957f">helib::DoubleCRT::sampleSmallBounded</a></div><div class="ttdeci">double sampleSmallBounded()</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:1211</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_afac4fc2420b57eeb2eb8a0faa136396e"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#afac4fc2420b57eeb2eb8a0faa136396e">helib::DoubleCRT::automorph</a></div><div class="ttdeci">void automorph(long k)</div><div class="ttdoc">Apply the automorphism F(X) --&gt; F(X^k) (with gcd(k,m)=1)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:979</div></div>
<div class="ttc" id="anamespacehelib_html"><div class="ttname"><a href="namespacehelib.html">helib</a></div><div class="ttdef"><b>Definition:</b> apiAttributes.h:21</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a8f89ba3eda006c1fc14b7b52fe7ca4f3"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a8f89ba3eda006c1fc14b7b52fe7ca4f3">helib::DoubleCRT::reduce</a></div><div class="ttdeci">void reduce() const</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:390</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a8ea63e63721e62276f1277eaeefa25f8"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a8ea63e63721e62276f1277eaeefa25f8">helib::DoubleCRT::sampleUniform</a></div><div class="ttdeci">double sampleUniform(long B)</div><div class="ttdoc">Coefficients are uniform in [-B..B].</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:1261</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a2208cba94ed47b3062e33d09d9bcd04f"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a2208cba94ed47b3062e33d09d9bcd04f">helib::DoubleCRT::operator*=</a></div><div class="ttdeci">DoubleCRT &amp; operator*=(const NTL::ZZX &amp;poly)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:308</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a067a11ce98dc23c255e8e14469936a0d"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a067a11ce98dc23c255e8e14469936a0d">helib::DoubleCRT::setPrimes</a></div><div class="ttdeci">void setPrimes(const IndexSet &amp;s1)</div><div class="ttdoc">@ brief make prime set equal to s1</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:259</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a842f11906b1bc36b48ae4a8d62b4ff91"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a842f11906b1bc36b48ae4a8d62b4ff91">helib::DoubleCRT::sampleSmall</a></div><div class="ttdeci">double sampleSmall()</div><div class="ttdoc">Coefficients are -1/0/1, Prob[0]=1/2.</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:1202</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a91e564b60dd913a2255718a1fa5fe0d7"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a91e564b60dd913a2255718a1fa5fe0d7">helib::DoubleCRT::operator-=</a></div><div class="ttdeci">DoubleCRT &amp; operator-=(long num)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:290</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a57655b2b38af885b0fa4c67113b7b14d"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a57655b2b38af885b0fa4c67113b7b14d">helib::DoubleCRT::operator++</a></div><div class="ttdeci">DoubleCRT &amp; operator++()</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:293</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a5eaea93daef76b525e97bed6baffaf75"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a5eaea93daef76b525e97bed6baffaf75">helib::DoubleCRT::operator*=</a></div><div class="ttdeci">DoubleCRT &amp; operator*=(const DoubleCRT &amp;other)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:302</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a328217c45be92b409dc511fb7b5116a5"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a328217c45be92b409dc511fb7b5116a5">helib::DoubleCRT::Sub</a></div><div class="ttdeci">void Sub(const DoubleCRT &amp;other, bool matchIndexSets=true)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:320</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a27064d89f77f57740b03d2108fe62d0f"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a27064d89f77f57740b03d2108fe62d0f">helib::DoubleCRT::addPrimes</a></div><div class="ttdeci">void addPrimes(const IndexSet &amp;s1, NTL::ZZX *poly_p=0)</div><div class="ttdoc">Expand the index set by s1. It is assumed that s1 is disjoint from the current index set....</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:384</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a8a09a101d684b9f2a444c27febdff627"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a8a09a101d684b9f2a444c27febdff627">helib::DoubleCRT::addPrimesAndScale</a></div><div class="ttdeci">double addPrimesAndScale(const IndexSet &amp;s1)</div><div class="ttdoc">Expand index set by s1, and multiply by Prod_{q in s1}. s1 is disjoint from the current index set,...</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:422</div></div>
<div class="ttc" id="aclasshelib_1_1_context_html"><div class="ttname"><a href="classhelib_1_1_context.html">helib::Context</a></div><div class="ttdoc">Maintaining the parameters.</div><div class="ttdef"><b>Definition:</b> Context.h:58</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a1d18d021e42bb0fcf2ed970c6fa599c8"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a1d18d021e42bb0fcf2ed970c6fa599c8">helib::DoubleCRT::scaleDownToSet</a></div><div class="ttdeci">void scaleDownToSet(const IndexSet &amp;s, long ptxtSpace, NTL::ZZX &amp;delta)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:1277</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a631f72e6137f32949db5d7aafb44fda0"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a631f72e6137f32949db5d7aafb44fda0">helib::DoubleCRT::DoubleCRT</a></div><div class="ttdeci">DoubleCRT(const DoubleCRT &amp;other)=default</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a045b2bda01f9ff183b5e31e6b90bc4cf"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a045b2bda01f9ff183b5e31e6b90bc4cf">helib::DoubleCRT::Mul</a></div><div class="ttdeci">void Mul(const DoubleCRT &amp;other, bool matchIndexSets=true)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:325</div></div>
<div class="ttc" id="aclasshelib_1_1_index_map_html_a71e808a119fbe9f2af2ea4d7547f9207"><div class="ttname"><a href="classhelib_1_1_index_map.html#a71e808a119fbe9f2af2ea4d7547f9207">helib::IndexMap::remove</a></div><div class="ttdeci">void remove(long j)</div><div class="ttdoc">Delete indexes from IndexSet, may cause objects to be destroyed.</div><div class="ttdef"><b>Definition:</b> IndexMap.h:102</div></div>
<div class="ttc" id="aclasshelib_1_1_index_map_init_html"><div class="ttname"><a href="classhelib_1_1_index_map_init.html">helib::IndexMapInit</a></div><div class="ttdoc">Initializing elements in an IndexMap.</div><div class="ttdef"><b>Definition:</b> IndexMap.h:27</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_aad5a926f22147af844cc596f9ff55ad3"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#aad5a926f22147af844cc596f9ff55ad3">helib::DoubleCRT::Exp</a></div><div class="ttdeci">void Exp(long k)</div><div class="ttdoc">Small-exponent polynomial exponentiation.</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:961</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a09c2f0e8a49dec1a23cba7514db21956"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a09c2f0e8a49dec1a23cba7514db21956">helib::DoubleCRT::operator+=</a></div><div class="ttdeci">DoubleCRT &amp; operator+=(const NTL::ZZ &amp;num)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:280</div></div>
<div class="ttc" id="anamespacehelib_html_af5a79c25bb9e1285c93b486ce07c4d52"><div class="ttname"><a href="namespacehelib.html#af5a79c25bb9e1285c93b486ce07c4d52">helib::conv</a></div><div class="ttdeci">void conv(DoubleCRT &amp;d, const NTL::ZZX &amp;p)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:403</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_aa8f223c17ea3db63f0e85a951d5854d4"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#aa8f223c17ea3db63f0e85a951d5854d4">helib::DoubleCRT::Add</a></div><div class="ttdeci">void Add(const DoubleCRT &amp;other, bool matchIndexSets=true)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:315</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_ac2e5c6c1238fb7bfcab215213d57cc13"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#ac2e5c6c1238fb7bfcab215213d57cc13">helib::DoubleCRT::operator-=</a></div><div class="ttdeci">DoubleCRT &amp; operator-=(const DoubleCRT &amp;other)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:284</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a312c1538cfa9f1107e71164b04e0e9f7"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a312c1538cfa9f1107e71164b04e0e9f7">helib::DoubleCRT::operator&gt;&gt;=</a></div><div class="ttdeci">DoubleCRT &amp; operator&gt;&gt;=(long k)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:340</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_ae9dd652a2d96b2e1892c1bc049237507"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#ae9dd652a2d96b2e1892c1bc049237507">helib::DoubleCRT::operator&lt;&lt;</a></div><div class="ttdeci">friend std::ostream &amp; operator&lt;&lt;(std::ostream &amp;s, const DoubleCRT &amp;d)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:1331</div></div>
<div class="ttc" id="anamespacehelib_html_a3652f33aab9e225a4c136eb14a50bc53"><div class="ttname"><a href="namespacehelib.html#a3652f33aab9e225a4c136eb14a50bc53">helib::ZZXptr</a></div><div class="ttdeci">std::shared_ptr&lt; NTL::ZZX &gt; ZZXptr</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:422</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a68dbfc4cbeb18fa08fd6309719645a32"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a68dbfc4cbeb18fa08fd6309719645a32">helib::DoubleCRT::SetZero</a></div><div class="ttdeci">DoubleCRT &amp; SetZero()</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:227</div></div>
<div class="ttc" id="azz_x_8h_html"><div class="ttname"><a href="zz_x_8h.html">zzX.h</a></div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_afcbce63268124352f675ffdcf1d9fbc6"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#afcbce63268124352f675ffdcf1d9fbc6">helib::DoubleCRT::operator+=</a></div><div class="ttdeci">DoubleCRT &amp; operator+=(const NTL::ZZX &amp;poly)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:278</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a9535bb1c1cff9fbedacfcc56a8f4ab4e"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a9535bb1c1cff9fbedacfcc56a8f4ab4e">helib::DoubleCRT::randomize</a></div><div class="ttdeci">void randomize(const NTL::ZZ *seed=nullptr)</div><div class="ttdoc">Fills each row i with random ints mod pi, uses NTL's PRG.</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:1079</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a5979ae811d8392e902d52441a3906f6f"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a5979ae811d8392e902d52441a3906f6f">helib::DoubleCRT::Negate</a></div><div class="ttdeci">DoubleCRT &amp; Negate()</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:274</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_ab862cf071d7d9b4705a71a12276c7448"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#ab862cf071d7d9b4705a71a12276c7448">helib::DoubleCRT::operator+=</a></div><div class="ttdeci">DoubleCRT &amp; operator+=(const DoubleCRT &amp;other)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:276</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_helper_html_a2a5120c6b955c4cdc9aa6a998111614f"><div class="ttname"><a href="classhelib_1_1_double_c_r_t_helper.html#a2a5120c6b955c4cdc9aa6a998111614f">helib::DoubleCRTHelper::init</a></div><div class="ttdeci">virtual void init(NTL::vec_long &amp;v)</div><div class="ttdoc">the init method ensures that all rows have the same size</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:42</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a6344aee3b06c937a8a357e9add21d0d1"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a6344aee3b06c937a8a357e9add21d0d1">helib::DoubleCRT::breakIntoDigits</a></div><div class="ttdeci">NTL::xdouble breakIntoDigits(std::vector&lt; DoubleCRT &gt; &amp;dgts) const</div><div class="ttdoc">Break into n digits,according to the primeSets in context.digits. See Section 3.1....</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:297</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_a86bba624e14ddc8a86e5228c1e2bffad"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#a86bba624e14ddc8a86e5228c1e2bffad">helib::DoubleCRT::FFT</a></div><div class="ttdeci">void FFT(const NTL::ZZX &amp;poly, const IndexSet &amp;s)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.cpp:50</div></div>
<div class="ttc" id="aclasshelib_1_1_double_c_r_t_html_aa6213e7fbf81a7d76a7a3eca2c255bf4"><div class="ttname"><a href="classhelib_1_1_double_c_r_t.html#aa6213e7fbf81a7d76a7a3eca2c255bf4">helib::DoubleCRT::operator++</a></div><div class="ttdeci">void operator++(int)</div><div class="ttdef"><b>Definition:</b> DoubleCRT.h:298</div></div>
<div class="ttc" id="a_index_map_8h_html"><div class="ttname"><a href="_index_map_8h.html">IndexMap.h</a></div><div class="ttdoc">Implementation of a map indexed by a dynamic set of integers.</div></div>
<!-- HTML footer for doxygen 1.8.8-->
<!-- start footer part -->
</div>
</div>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
        <script type="text/javascript" src="doxy-boot.js"></script>
</html>
